package it.unisa.unibox.junit.beans;

import it.unisa.unibox.beans.Account;
import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class AccountTest extends TestCase {

	private Account acc;

	@Override
	@Before
	public void setUp() {
		try {
			acc=new Account(999, "Mario80", "passDiMario", 2);
		} catch (Exception e) {
			fail();
		}
	}

	@Override
	@After
	public void tearDown() {
		acc=null;
		System.gc();	
	}

	@Test
	public void testGetId() {
		int id = acc.getId();
		assertEquals(id,999);
	}

	@Test
	public void testGetUsername() {
		assertEquals(acc.getUsername(),"Mario80");
	}
	
	@Test
	public void testGetPassword() {
		assertEquals(acc.getPassword(),"passDiMario");
	}

	@Test
	public void getTipologia() {
		assertEquals(acc.getTipologia(),2);
	}

}
